using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class FacilityTypeMap : EntityTypeConfiguration<FacilityType>
    {
        public FacilityTypeMap()
        {
            // Primary Key
            this.HasKey(t => t.FacilityTypeID);

            // Properties
            this.Property(t => t.Type)
                .HasMaxLength(20);

            this.Property(t => t.FacilityTypeIDColor)
                .HasMaxLength(10);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("FacilityType");
            this.Property(t => t.FacilityTypeID).HasColumnName("FacilityTypeID");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.FacilityTypeIDColor).HasColumnName("FacilityTypeIDColor");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
        }
    }
}
